/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.aurelius.relations;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 */
@Entity
@Table(name = "MICROPROCESSOR")
public class Microprocessor implements Serializable {

    @Id
    private int id;
    private String producent;
    private String commercialName;

    @OneToMany(mappedBy= "microprocessor", fetch= FetchType.EAGER)
    private Set<Transistor> transistors ;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProducent() {
        return producent;
    }

    public void setProducent(String producent) {
        this.producent = producent;
    }

    public String getCommercialName() {
        return commercialName;
    }

    public void setCommercialName(String commercialName) {
        this.commercialName = commercialName;
    }

    public Set<Transistor> getTransistors() {
        return transistors;
    }

    public void setTransistors(Set<Transistor> transistors) {
        this.transistors = transistors;
    }

    public Microprocessor() {
    }

    @Override
    public String toString() {
        return "Microprocessor{" + "id=" + id + ", producent=" + producent + ", commercialName=" + commercialName + ", transistors=" + transistors + '}';
    }

}
